import Api from "../../request/api"

export default{
    namespaced: true,
    state: {
        adminlist: [],
        admintotal:0
    },
    mutations: {
        initAdminList(state, payload) {
            state.adminlist = payload
        },
        initAdminTotal(state, payload) {
            state.admintotal = payload
        }
    },
    actions: {
        getadminlist({commit},payload) { 
            Api.userlist(payload).then(res => {
                if (res.code == 200) {
                    commit("initAdminList", res.list)
                }
            })
        },
        getadmintotal({commit}) { 
            Api.usercount().then(res => {
                if (res.code == 200) {
                    console.log(res,111);
                    commit("initAdminTotal", res.list[0].total)
                }
            })
        }

    }
}